function showPage(index) {
    for (let i = 1; i <= 4; i++) {
        document.getElementById('content' + i).style.display = 'none';
    }
    document.getElementById('content' + index).style.display = 'block';
}

document.getElementById('page1').addEventListener('click', function() {
    showPage(1);
});
document.getElementById('page2').addEventListener('click', function() {
    showPage(2);
});
document.getElementById('page3').addEventListener('click', function() {
    showPage(3);
});
document.getElementById('page4').addEventListener('click', function() {
    showPage(4);
});